<?php
	
if (isset($haya_post_like_config['thread_like_position'])
	&& $haya_post_like_config['thread_like_position'] == 2
) {

	if (isset($haya_post_like_config['open_thread'])
		&& $haya_post_like_config['open_thread'] == 1
	) {
	?>
		<?php $haya_post_like_thread_check = haya_post_like_find_by_uid_and_pid($uid, $first['pid']); ?>

		<div class="haya-post-like px-2">
			<span class="btn-group" role="group">
				<?php if (!empty($uid)) { ?>
					<?php if($haya_post_like_thread_check){ ?>
						<button class="btn btn-outline-secondary js-haya-post-like-thread-del" data-pid="<?php echo $first['pid'];?>" title="<?php echo $haya_post_like_is_delete ? lang('haya_post_like_unlike') : lang('haya_post_like_has_like'); ?>">
							<i class="icon icon-thumbs-up" aria-label="<?php echo $haya_post_like_is_delete ? lang('haya_post_like_unlike') : lang('haya_post_like_has_like'); ?>"></i>
							<span class="haya-post-like-thread-btn"><?php echo lang('haya_post_like_has_like'); ?></span>
						</button>
					<?php } else { ?>
						<button class="btn btn-outline-secondary js-haya-post-like-thread-add" data-pid="<?php echo $first['pid'];?>" title="点赞本帖">
							<i class="icon icon-thumbs-o-up" aria-label="<?php echo lang('haya_post_like_like_thread'); ?>"></i>
							<span class="haya-post-like-thread-btn"><?php echo lang('haya_post_like_like'); ?></span>
						</button>
					<?php } ?>	
				<?php } else { ?>
					<button class="btn btn-outline-secondary js-haya-post-like-thread-tip" data-pid="<?php echo $first['pid'];?>" title="点赞本帖">
						<i class="icon icon-thumbs-o-up" aria-label="<?php echo lang('haya_post_like_like_thread'); ?>"></i>
						<span class="haya-post-like-thread-btn"><?php echo lang('haya_post_like_like'); ?></span>
					</button>
				<?php } ?>

				<button class="btn btn-outline-secondary" title="<?php echo lang('haya_post_like_like_count'); ?>" data-tid="<?php echo $tid;?>">
					<span class="haya-post-like-thread-user-count"><?php echo intval($first['likes']); ?></span>
				</button>
			</span>
		</div>
	<?php } ?>

<?php } ?>
